<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_GHC -optc-DPROFILING #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LINE 1 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Module      :  GHC.Stack.CCS</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2011</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  non-portable (GHC Extensions)</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Access to GHC's call-stack simulation</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- @since 4.5.0.0</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE UnboxedTuples, MagicHash, NoImplicitPrelude #-}</span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Stack.CCS</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Call stacks</span></span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#currentCallStack"><span class="hs-identifier">currentCallStack</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#whoCreated"><span class="hs-identifier">whoCreated</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Internals</span></span><span>
</span><span id="line-25"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier">CostCentreStack</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier">CostCentre</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#getCurrentCCS"><span class="hs-identifier">getCurrentCCS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#getCCSOf"><span class="hs-identifier">getCCSOf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#clearCCS"><span class="hs-identifier">clearCCS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccsCC"><span class="hs-identifier">ccsCC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccsParent"><span class="hs-identifier">ccsParent</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccLabel"><span class="hs-identifier">ccLabel</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccModule"><span class="hs-identifier">ccModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccSrcSpan"><span class="hs-identifier">ccSrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#ccsToStrings"><span class="hs-identifier">ccsToStrings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><a href="GHC.Stack.CCS.html#renderStack"><span class="hs-identifier">renderStack</span></a></span><span>
</span><span id="line-37"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.html"><span class="hs-identifier">Foreign</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.C.html"><span class="hs-identifier">Foreign.C</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Ptr.html"><span class="hs-identifier">GHC.Ptr</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Foreign.html"><span class="hs-identifier">GHC.Foreign</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.html"><span class="hs-identifier">GHC.IO.Encoding</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.List.html"><span class="hs-identifier">GHC.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.List.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#reverse"><span class="hs-identifier">reverse</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | A cost-centre stack from GHC's cost-center profiler.</span><span>
</span><span id="line-52"></span><span class="hs-keyword">data</span><span> </span><span id="CostCentreStack"><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-var">CostCentreStack</span></a></span></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-comment">-- | A cost-centre from GHC's cost-center profiler.</span><span>
</span><span id="line-55"></span><span class="hs-keyword">data</span><span> </span><span id="CostCentre"><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier hs-var">CostCentre</span></a></span></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-comment">-- | Returns the current 'CostCentreStack' (value is @nullPtr@ if the current</span><span>
</span><span id="line-58"></span><span class="hs-comment">-- program was not compiled with profiling support). Takes a dummy argument</span><span>
</span><span id="line-59"></span><span class="hs-comment">-- which can be used to avoid the call to @getCurrentCCS@ being floated out by</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- the simplifier, which would result in an uninformative stack (&quot;CAF&quot;).</span><span>
</span><span id="line-61"></span><span id="local-6989586621679486952"><span class="annot"><a href="GHC.Stack.CCS.html#getCurrentCCS"><span class="hs-identifier hs-type">getCurrentCCS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679486952"><span class="hs-identifier hs-type">dummy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-62"></span><span id="getCurrentCCS"><span class="annot"><span class="annottext">getCurrentCCS :: forall dummy. dummy -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#getCurrentCCS"><span class="hs-identifier hs-var hs-var">getCurrentCCS</span></a></span></span><span> </span><span id="local-6989586621679486900"><span class="annot"><span class="annottext">dummy
</span><a href="#local-6989586621679486900"><span class="hs-identifier hs-var">dummy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, Ptr CostCentreStack #))
-&gt; IO (Ptr CostCentreStack)
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, Ptr CostCentreStack #))
 -&gt; IO (Ptr CostCentreStack))
-&gt; (State# RealWorld
    -&gt; (# State# RealWorld, Ptr CostCentreStack #))
-&gt; IO (Ptr CostCentreStack)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679486899"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486899"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-63"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">dummy -&gt; State# RealWorld -&gt; (# State# RealWorld, Addr# #)
forall a d. a -&gt; State# d -&gt; (# State# d, Addr# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#getCurrentCCS%23"><span class="hs-identifier hs-var">getCurrentCCS#</span></a></span><span> </span><span class="annot"><span class="annottext">dummy
</span><a href="#local-6989586621679486900"><span class="hs-identifier hs-var">dummy</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486899"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-64"></span><span>     </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679486898"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486898"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679486897"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679486897"><span class="hs-identifier hs-var">addr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486898"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Ptr CostCentreStack
forall a. Addr# -&gt; Ptr a
</span><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679486897"><span class="hs-identifier hs-var">addr</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- | Get the 'CostCentreStack' associated with the given value.</span><span>
</span><span id="line-67"></span><span id="local-6989586621679486895"><span class="annot"><a href="GHC.Stack.CCS.html#getCCSOf"><span class="hs-identifier hs-type">getCCSOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679486895"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-68"></span><span id="getCCSOf"><span class="annot"><span class="annottext">getCCSOf :: forall dummy. dummy -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#getCCSOf"><span class="hs-identifier hs-var hs-var">getCCSOf</span></a></span></span><span> </span><span id="local-6989586621679486894"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679486894"><span class="hs-identifier hs-var">obj</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, Ptr CostCentreStack #))
-&gt; IO (Ptr CostCentreStack)
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, Ptr CostCentreStack #))
 -&gt; IO (Ptr CostCentreStack))
-&gt; (State# RealWorld
    -&gt; (# State# RealWorld, Ptr CostCentreStack #))
-&gt; IO (Ptr CostCentreStack)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679486893"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486893"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-69"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; State# RealWorld -&gt; (# State# RealWorld, Addr# #)
forall a d. a -&gt; State# d -&gt; (# State# d, Addr# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#getCCSOf%23"><span class="hs-identifier hs-var">getCCSOf#</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679486894"><span class="hs-identifier hs-var">obj</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486893"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-70"></span><span>     </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679486892"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486892"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679486891"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679486891"><span class="hs-identifier hs-var">addr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486892"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Ptr CostCentreStack
forall a. Addr# -&gt; Ptr a
</span><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679486891"><span class="hs-identifier hs-var">addr</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | Run a computation with an empty cost-center stack. For example, this is</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- used by the interpreter to run an interpreted computation without the call</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- stack showing that it was invoked from GHC.</span><span>
</span><span id="line-75"></span><span id="local-6989586621679486942"><span class="annot"><a href="GHC.Stack.CCS.html#clearCCS"><span class="hs-identifier hs-type">clearCCS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679486942"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679486942"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-76"></span><span id="clearCCS"><span class="annot"><span class="annottext">clearCCS :: forall a. IO a -&gt; IO a
</span><a href="GHC.Stack.CCS.html#clearCCS"><span class="hs-identifier hs-var hs-var">clearCCS</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span id="local-6989586621679486890"><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679486890"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679486889"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486889"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, a #))
-&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
forall d a.
(State# d -&gt; (# State# d, a #)) -&gt; State# d -&gt; (# State# d, a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#clearCCS%23"><span class="hs-identifier hs-var">clearCCS#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679486890"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679486889"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">-- | Get the 'CostCentre' at the head of a 'CostCentreStack'.</span><span>
</span><span id="line-79"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccsCC"><span class="hs-identifier hs-type">ccsCC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span id="ccsCC"><span class="annot"><span class="annottext">ccsCC :: Ptr CostCentreStack -&gt; IO (Ptr CostCentre)
</span><a href="GHC.Stack.CCS.html#ccsCC"><span class="hs-identifier hs-var hs-var">ccsCC</span></a></span></span><span> </span><span id="local-6989586621679486888"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486888"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679486887"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486887"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; Int -&gt; IO (Ptr CostCentre)
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486887"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486888"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-81"></span><span class="hs-pragma">{-# LINE 81 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="hs-comment">-- | Get the tail of a 'CostCentreStack'.</span><span>
</span><span id="line-83"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccsParent"><span class="hs-identifier hs-type">ccsParent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-84"></span><span id="ccsParent"><span class="annot"><span class="annottext">ccsParent :: Ptr CostCentreStack -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#ccsParent"><span class="hs-identifier hs-var hs-var">ccsParent</span></a></span></span><span> </span><span id="local-6989586621679486885"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486885"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679486884"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486884"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; Int -&gt; IO (Ptr CostCentreStack)
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486884"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486885"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-85"></span><span class="hs-pragma">{-# LINE 85 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="hs-comment">-- | Get the label of a 'CostCentre'.</span><span>
</span><span id="line-87"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccLabel"><span class="hs-identifier hs-type">ccLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="Foreign.C.String.html#CString"><span class="hs-identifier hs-type">CString</span></a></span><span>
</span><span id="line-88"></span><span id="ccLabel"><span class="annot"><span class="annottext">ccLabel :: Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccLabel"><span class="hs-identifier hs-var hs-var">ccLabel</span></a></span></span><span> </span><span id="local-6989586621679486883"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486883"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679486882"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486882"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; Int -&gt; IO CString
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486882"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486883"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-89"></span><span class="hs-pragma">{-# LINE 89 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-- | Get the module of a 'CostCentre'.</span><span>
</span><span id="line-91"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccModule"><span class="hs-identifier hs-type">ccModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="Foreign.C.String.html#CString"><span class="hs-identifier hs-type">CString</span></a></span><span>
</span><span id="line-92"></span><span id="ccModule"><span class="annot"><span class="annottext">ccModule :: Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccModule"><span class="hs-identifier hs-var hs-var">ccModule</span></a></span></span><span> </span><span id="local-6989586621679486881"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486881"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679486880"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486880"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; Int -&gt; IO CString
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486880"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486881"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-93"></span><span class="hs-pragma">{-# LINE 93 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-comment">-- | Get the source span of a 'CostCentre'.</span><span>
</span><span id="line-95"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccSrcSpan"><span class="hs-identifier hs-type">ccSrcSpan</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="Foreign.C.String.html#CString"><span class="hs-identifier hs-type">CString</span></a></span><span>
</span><span id="line-96"></span><span id="ccSrcSpan"><span class="annot"><span class="annottext">ccSrcSpan :: Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccSrcSpan"><span class="hs-identifier hs-var hs-var">ccSrcSpan</span></a></span></span><span> </span><span id="local-6989586621679486879"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486879"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679486878"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486878"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; Int -&gt; IO CString
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486878"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">24</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486879"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-97"></span><span class="hs-pragma">{-# LINE 97 &quot;libraries\\base\\GHC\\Stack\\CCS.hsc&quot; #-}</span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="hs-comment">-- | Returns a @[String]@ representing the current call stack.  This</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- can be useful for debugging.</span><span>
</span><span id="line-100"></span><span class="hs-comment">--</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- The implementation uses the call-stack simulation maintained by the</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- profiler, so it only works if the program was compiled with @-prof@</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- and contains suitable SCC annotations (e.g. by using @-fprof-auto@).</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- Otherwise, the list returned is likely to be empty or</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- uninformative.</span><span>
</span><span id="line-106"></span><span class="hs-comment">--</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- @since 4.5.0.0</span><span>
</span><span id="line-108"></span><span class="annot"><a href="GHC.Stack.CCS.html#currentCallStack"><span class="hs-identifier hs-type">currentCallStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-109"></span><span id="currentCallStack"><span class="annot"><span class="annottext">currentCallStack :: IO [String]
</span><a href="GHC.Stack.CCS.html#currentCallStack"><span class="hs-identifier hs-var hs-var">currentCallStack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; IO [String]
</span><a href="GHC.Stack.CCS.html#ccsToStrings"><span class="hs-identifier hs-var">ccsToStrings</span></a></span><span> </span><span class="annot"><span class="annottext">(Ptr CostCentreStack -&gt; IO [String])
-&gt; IO (Ptr CostCentreStack) -&gt; IO [String]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO (Ptr CostCentreStack)
forall dummy. dummy -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#getCurrentCCS"><span class="hs-identifier hs-var">getCurrentCCS</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span class="hs-comment">-- | Format a 'CostCentreStack' as a list of lines.</span><span>
</span><span id="line-112"></span><span class="annot"><a href="GHC.Stack.CCS.html#ccsToStrings"><span class="hs-identifier hs-type">ccsToStrings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="GHC.Stack.CCS.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-113"></span><span id="ccsToStrings"><span class="annot"><span class="annottext">ccsToStrings :: Ptr CostCentreStack -&gt; IO [String]
</span><a href="GHC.Stack.CCS.html#ccsToStrings"><span class="hs-identifier hs-var hs-var">ccsToStrings</span></a></span></span><span> </span><span id="local-6989586621679486876"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486876"><span class="hs-identifier hs-var">ccs0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679486875"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486876"><span class="hs-identifier hs-var">ccs0</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621679486875"><span class="annot"><span class="annottext">go :: Ptr CostCentreStack -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679486875"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679486857"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486857"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621679486856"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486856"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-116"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486857"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; Ptr CostCentreStack -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
forall a. Ptr a
</span><a href="GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486856"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-117"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-118"></span><span>        </span><span id="local-6989586621679486854"><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486854"><span class="hs-identifier hs-var">cc</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; IO (Ptr CostCentre)
</span><a href="GHC.Stack.CCS.html#ccsCC"><span class="hs-identifier hs-var">ccsCC</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486857"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-119"></span><span>        </span><span id="local-6989586621679486853"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486853"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TextEncoding -&gt; CString -&gt; IO String
</span><a href="GHC.Foreign.html#peekCString"><span class="hs-identifier hs-var">GHC.peekCString</span></a></span><span> </span><span class="annot"><span class="annottext">TextEncoding
</span><a href="GHC.IO.Encoding.html#utf8"><span class="hs-identifier hs-var">utf8</span></a></span><span> </span><span class="annot"><span class="annottext">(CString -&gt; IO String) -&gt; IO CString -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccLabel"><span class="hs-identifier hs-var">ccLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486854"><span class="hs-identifier hs-var">cc</span></a></span><span>
</span><span id="line-120"></span><span>        </span><span id="local-6989586621679486850"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486850"><span class="hs-identifier hs-var">mdl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TextEncoding -&gt; CString -&gt; IO String
</span><a href="GHC.Foreign.html#peekCString"><span class="hs-identifier hs-var">GHC.peekCString</span></a></span><span> </span><span class="annot"><span class="annottext">TextEncoding
</span><a href="GHC.IO.Encoding.html#utf8"><span class="hs-identifier hs-var">utf8</span></a></span><span> </span><span class="annot"><span class="annottext">(CString -&gt; IO String) -&gt; IO CString -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccModule"><span class="hs-identifier hs-var">ccModule</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486854"><span class="hs-identifier hs-var">cc</span></a></span><span>
</span><span id="line-121"></span><span>        </span><span id="local-6989586621679486849"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486849"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TextEncoding -&gt; CString -&gt; IO String
</span><a href="GHC.Foreign.html#peekCString"><span class="hs-identifier hs-var">GHC.peekCString</span></a></span><span> </span><span class="annot"><span class="annottext">TextEncoding
</span><a href="GHC.IO.Encoding.html#utf8"><span class="hs-identifier hs-var">utf8</span></a></span><span> </span><span class="annot"><span class="annottext">(CString -&gt; IO String) -&gt; IO CString -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre -&gt; IO CString
</span><a href="GHC.Stack.CCS.html#ccSrcSpan"><span class="hs-identifier hs-var">ccSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentre
</span><a href="#local-6989586621679486854"><span class="hs-identifier hs-var">cc</span></a></span><span>
</span><span id="line-122"></span><span>        </span><span id="local-6989586621679486848"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486848"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#ccsParent"><span class="hs-identifier hs-var">ccsParent</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486857"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-123"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486850"><span class="hs-identifier hs-var">mdl</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;MAIN&quot;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486853"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;MAIN&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486856"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-125"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679486875"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486848"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486850"><span class="hs-identifier hs-var">mdl</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486853"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679486849"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;)&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486856"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | Get the stack trace attached to an object.</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- @since 4.5.0.0</span><span>
</span><span id="line-130"></span><span id="local-6989586621679486927"><span class="annot"><a href="GHC.Stack.CCS.html#whoCreated"><span class="hs-identifier hs-type">whoCreated</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679486927"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-131"></span><span id="whoCreated"><span class="annot"><span class="annottext">whoCreated :: forall a. a -&gt; IO [String]
</span><a href="GHC.Stack.CCS.html#whoCreated"><span class="hs-identifier hs-var hs-var">whoCreated</span></a></span></span><span> </span><span id="local-6989586621679486845"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679486845"><span class="hs-identifier hs-var">obj</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-132"></span><span>  </span><span id="local-6989586621679486844"><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486844"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO (Ptr CostCentreStack)
forall dummy. dummy -&gt; IO (Ptr CostCentreStack)
</span><a href="GHC.Stack.CCS.html#getCCSOf"><span class="hs-identifier hs-var">getCCSOf</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679486845"><span class="hs-identifier hs-var">obj</span></a></span><span>
</span><span id="line-133"></span><span>  </span><span class="annot"><span class="annottext">Ptr CostCentreStack -&gt; IO [String]
</span><a href="GHC.Stack.CCS.html#ccsToStrings"><span class="hs-identifier hs-var">ccsToStrings</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CostCentreStack
</span><a href="#local-6989586621679486844"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="annot"><a href="GHC.Stack.CCS.html#renderStack"><span class="hs-identifier hs-type">renderStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-136"></span><span id="renderStack"><span class="annot"><span class="annottext">renderStack :: [String] -&gt; String
</span><a href="GHC.Stack.CCS.html#renderStack"><span class="hs-identifier hs-var hs-var">renderStack</span></a></span></span><span> </span><span id="local-6989586621679486843"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486843"><span class="hs-identifier hs-var">strs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-137"></span><span>  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CallStack (from -prof):&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; String
forall a b. (a -&gt; [b]) -&gt; [a] -&gt; [b]
</span><a href="GHC.List.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n  &quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679486843"><span class="hs-identifier hs-var">strs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-138"></span></pre></body></html>